const webpack = require('webpack');

module.exports = {
  head: {
    title: '同仁堂快递信息查询',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' },
      { hid: 'description', name: 'description', content: 'Nuxt.js project' },
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
      { rel: 'stylesheet', href: 'https://cdn.bootcss.com/element-ui/1.4.6/theme-default/index.css' },
    ],
  },
  /*
  ** Customize the progress-bar color
  */
  loading: { color: '#3B8070' },
  css: [
    // 'element-ui/lib/theme-default/index.css',
    { src: '~/assets/css/index.scss', lang: 'scss' },
  ],
  build: {
    /*
    ** Run ESLINT on save
    */
    extend (config, ctx) {
      if (ctx.isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/,
        });
      }
    },
    plugins: [
      new webpack.BannerPlugin('乐速科技 版权所有，翻版必究！  FE by imsunhao'),
    ],
    vendor: [
      'axios',
      'element-ui',
    ],
  },
  plugins: [
    // ssr: false to only include it on client-side
    '~/plugins/element-ui',
  ],
};
